# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=akonadi-calendar
pkgver=24.08.2
pkgrel=0
pkgdesc="Akonadi calendar integration"
# ppc64le, s390x, riscv64, armhf, armv7 blocked by kmailtransport -> libkgapi -> qt6-qtwebengine
# loongarch64 blocked by messagelib
arch="all !armhf !ppc64le !s390x !riscv64 !armv7 !loongarch64"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	akonadi-contacts-dev
	akonadi-dev
	kcalendarcore-dev
	kcalutils-dev
	kcodecs-dev
	kdbusaddons-dev
	ki18n-dev
	kiconthemes-dev
	kidentitymanagement-dev
	kio-dev
	kmailtransport-dev
	kwidgetsaddons-dev
	kxmlgui-dev
	messagelib-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/pim/akonadi-calendar.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/akonadi-calendar-$pkgver.tar.xz"
options="!check" # no tests

replaces="kalendar>1.0.0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure -E "kcalcoreserializertest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
24fe49f90c049f26fee00cedefae1dcd2f0b0a2db68bb6ca08a7af3c9fb075cedf9d5dc5599249f1efbd188ae82824d7d842115afe8a0bd4f17e4ab197437857  akonadi-calendar-24.08.2.tar.xz
"
